package come.bjpowernode.javase.reflect.fieldReflect;

import java.lang.reflect.Field;

public class GetDeclaredFieldTest {
    public static void main(String[] args) throws IllegalAccessException {
        Person person = new Person("孙学腾",25);
        for (Field declaredField : person.getClass().getDeclaredFields()) {
            declaredField.setAccessible(true);
            Object o = declaredField.get(person);
            System.out.println(o);
        }
    }
}
